<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/jsp/taglib.jsp"%>
<%@page import="com.framework.utils.ConfigUtil"%>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jqGird</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="${ctxStatic}/plugins/h+/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/animate.min.css" rel="stylesheet">
    <%--<link href="${ctxStatic}/plugins/h+/css/style.min862f.css?v=4.1.0" rel="stylesheet">--%>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/plugins/h+/css/plugins/webuploader/webuploader.css">
    <link href="${ctxStatic}/plugins/h+/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">

    <link href="${ctxStatic}/plugins/h+/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/animate.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <style>
        .dtupload>img{
            width: 54px;
            padding-left: 39px;
            padding-top: 16px;
        }
        .dtupload>a{
            color: #268eff;
            font-size: 12px;
            position: relative;
            left: 26px;
            top: 10px;
        }.dtupload>a:hover,
         .shoplogo>a:hover{
             color:#F93;
         }.upload_pic {
              height: 70px;
              width:70px;
              position: relative;
              cursor: pointer;
              color: #ccbe9e;
              background: #fff;
              overflow: hidden;
              display: inline-block;
              *display: inline;
              *zoom: 1;
          }
        .upload_pic input {
            position: absolute;
            height:100%;
            width:100%;
            right: 0;
            top: 0;
            opacity: 0;
            filter: alpha(opacity=0);
            cursor: pointer
        }
        .upload_pic:hover {
            color: #ccbe9e;
            background: #fff;
            text-decoration: none
        }

    </style>

</head>

<body class="gray-bg" >
<div class="wrapper wrapper-content  animated fadeInRight" id="ccbb">
    <form class="form-horizontal" onsubmit="return  false" id="wheelForm" name="wheelForm">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>大转盘设置</h5>
                </div>
                <div class="ibox-content">

                    <div class="row">
                        <div class="col-sm-8">
                            <label class="col-md-2" > 生效时间：</label>
                            <div class="col-md-4"><input placeholder="开始日期"  name="pwxWheel.startTime" style="width: 100%" id="search_startdate" class="form-control layer-date" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"></div>
                            <label class="col-md-1">到</label>
                            <div class="col-md-4"><input placeholder="结束日期" name="pwxWheel.endTime" style="width: 100%" id="search_enddate" class="form-control layer-date" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"></div>
<input type="hidden" name="pwxWheel.mainId" id="wheelmainid">

                        </div>
                        <div class="col-sm-4">
                            <label > 大转盘ID：</label>
                            <label id="dzpId"> 2010758888888</label>
                        </div>
                    </div>

                    <div class="row" style="margin-top: 10px;">
                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项一
                                    <small onclick="wheelRecord(1)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload1" onChange="uploadFile('fileToUpload1','imgUpdate1','shopPicId1');">
                                                <img  id="imgUpdate1" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId1" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name1" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_1" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_1" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量" id="pwheel_num_1"  class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_1" id="pwheel_percent_1" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项二
                                    <small onclick="wheelRecord(2)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload2" onChange="uploadFile('fileToUpload2','imgUpdate2','shopPicId2');">
                                                <img  id="imgUpdate2" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId2" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name2" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_2" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_2" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量" id="pwheel_num_2"  class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_2" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项三
                                    <small onclick="wheelRecord(3)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload3" onChange="uploadFile('fileToUpload3','imgUpdate3','shopPicId3');">
                                                <img  id="imgUpdate3" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId3" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name3" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_3" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_3" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量" id="pwheel_num_3"  class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_3" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项四
                                    <small onclick="wheelRecord(4)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload4" onChange="uploadFile('fileToUpload4','imgUpdate4','shopPicId4');">
                                                <img  id="imgUpdate4" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId4" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name4" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_4" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_4" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量"  id="pwheel_num_4" class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_4" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">

                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项五
                                    <small onclick="wheelRecord(5)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload5" onChange="uploadFile('fileToUpload5','imgUpdate5','shopPicId5');">
                                                <img  id="imgUpdate5" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId5" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name5" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_5" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_5" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量"  id="pwheel_num_5" class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_5" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项六
                                    <small onclick="wheelRecord(6)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload6" onChange="uploadFile('fileToUpload6','imgUpdate6','shopPicId6');">
                                                <img  id="imgUpdate6" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId6" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name6" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_6" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_6" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量" id="pwheel_num_6" class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_6" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项七
                                    <small onclick="wheelRecord(7)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload7" onChange="uploadFile('fileToUpload7','imgUpdate7','shopPicId7');">
                                                <img  id="imgUpdate7" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId7" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name7" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_7" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_7" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量" id="pwheel_num_7" class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_7" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="panel panel-success">
                                <div class="panel-heading">
                                    奖项八
                                    <small onclick="wheelRecord(8)" style="margin-left: 330px;">本期获奖名单</small>
                                </div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项图片：</label>
                                        <div class="dtupload col-sm-9">
                                            <a href="javascript:" class="upload_pic" style="height:100px;"><input type="file" name="fileToUpload" id="fileToUpload8" onChange="uploadFile('fileToUpload8','imgUpdate8','shopPicId8');">
                                                <img  id="imgUpdate8" src="${pageContext.request.contextPath}/resources/image/logopic1.png" width="100%"/>
                                                <input type="hidden" id="shopPicId8" name="pwxWheel.imgPath">
                                            </a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项名称：</label>
                                        <div class="col-sm-9">
                                            <input type="text" placeholder="奖项名称：" class="form-control" id="pwheel_name8" name="pwxWheel.name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖品类型：</label>
                                        <div class="col-sm-9">
                                            <select name="pwxWheel.type" id="pwheel_type_8" class="chosen-select" style="width:100%" >
                                                <option value="0">无奖项</option>
                                                <option value="1">久零券</option>
                                                <option value="2">实物奖</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >久零券值：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,1)" value="0" readonly="readonly" placeholder="久零券值" class="form-control" id="pwheel_num90_8" name="pwxWheel.num90">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >奖项数量：</label>
                                        <div class="col-sm-9">
                                            <input type="number" onblur="checkNum(this,0)" value="0" placeholder="奖项数量" id="pwheel_num_8" class="form-control"  name="pwxWheel.num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label" >中奖率%：</label>
                                        <div class="col-sm-9">
                                            <input type="text" onblur="checkNum(this,2)" value="0" placeholder="中奖率" id="pwheel_percent_8" class="form-control" name="pwxWheel.percent">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <label class="col-sm-2"> 大转盘当前状态：</label>
                            <div id="dzpzt" class="col-sm-10"> <label> <font color="green">已开启</font> </label></div>
                        </div>
                    </div>
                    <div class="row">
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-8">
                            <div  id="divTJ" class="col-sm-2"> <button class="btn btn-primary" onclick="doSave();">保存</button></div>
                            <div id="divGB" style="display: none"  class="col-sm-2"> <button class="btn btn-primary" onclick="doStop()">关闭</button></div>
                            <div id="divKQ" class="col-sm-2"> <button class="btn btn-primary"  onclick="doStart()">开启</button></div>
                        </div>
                    </div>
                    </div>


                </div>
            </div>
        </div>
    </div>
    </form>
    </div>
</body>
<script src="${ctxStatic}/plugins/h+/js/jquery.min.js?v=2.1.4"></script>

<!-- 配置文件 -->
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/plugins/utf8-jsp/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/plugins/utf8-jsp/ueditor.all.js"></script>
<script src="${ctxStatic}/plugins/h+/js/content.min.js?v=1.0.0"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/validate/jquery.validate.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/validate/messages_zh.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/demo/form-validate-demo.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/layer2.4/layer.js"></script>

<script src="${ctxStatic}/plugins/h+/js/bootstrap.min.js?v=3.3.5"></script>
<script src="${ctxStatic}/plugins/h+/js/content.min.js?v=1.0.0"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/chosen/chosen.jquery.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/jsKnob/jquery.knob.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/jasny/jasny-bootstrap.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/nouslider/jquery.nouislider.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/switchery/switchery.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/iCheck/icheck.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/clockpicker/clockpicker.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/cropper/cropper.min.js"></script>
<script src="${ctxStatic}/plugins/h+/js/demo/form-advanced-demo.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/ajaxfileupload.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/layer/laydate/laydate.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/ueditor1_4_2-utf8-jsp/ueditor.config.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/ueditor1_4_2-utf8-jsp/ueditor.all.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/ueditor1_4_2-utf8-jsp/lang/zh-cn/zh-cn.js"></script>





<script type="text/javascript">

</script>

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <script type="text/javascript">
        var picPath='<%=ConfigUtil.get("OSSURL")%>';
        loadData();
        
        function uploadFile(obj,id,picId){//上传图片
            var labid = "";
            //var detailId = $("#detailId").val();
            //$("#"+id).css("background","url(${pageContext.request.contextPath}/resources/assets/images/waiting.gif) no-repeat 0 0/100% 100%");
            $.ajaxFileUpload({
                url: '${pageContext.request.contextPath}/common/doUploadFile.ac',
                secureuri: false,
                type:'post',
                fileElementId: obj,
                dataType: 'text',
                success: function(data, status) {

                    var img=JSON.parse(data);
                    $("#"+id).attr("src",picPath+img.path);
                    $("#"+picId).val(picPath+img.path);

                },
                error: function(data, status, e) {
                    alert(e);
                }
            });
        }




        function  checkNum(obj,type) {

            if(type==1){
                var reg=/^[0-9]{1,}(?:.[0-9]{0,2})?$/;
                if(!reg.test(obj.value))
                {
                    alert("请正确输入数字,且保留小数点后2位");
                    obj.value="0.0";
                }
            }else  if(type==2){
                var reg=/^[0-9]{1,}(?:.[0-9]{0,2})?$/;
                if(!reg.test(obj.value))
                {
                    alert("请正确输入数字,且保留小数点后2位");
                    obj.value="0.0";
                }
                if(obj.value>100)
                {
                    alert("请正确输入数字,且不超过100");
                    obj.value="0.0";
                }
                jiSuanPercent(obj)

            }else {
                var value=obj.value;
                if(value==''||value<0)
                {
                    alert("请正确输入数字");
                    obj.value=0;
                }
            }

        }


        function jiSuanPercent(obj) {
            var objval = $(obj).val();
            if (objval == null || objval == undefined || objval == '') {
                $(obj).val("0");
            } else {
                //获取所有8个奖项概率
                var per1 = parseFloat($("#pwheel_percent_1").val());
                var per2 = parseFloat($("#pwheel_percent_2").val());
                var per3 = parseFloat($("#pwheel_percent_3").val());
                var per4 = parseFloat($("#pwheel_percent_4").val());
                var per5 = parseFloat($("#pwheel_percent_5").val());
                var per6 = parseFloat($("#pwheel_percent_6").val());
                var per7 = parseFloat($("#pwheel_percent_7").val());
                var per8 = parseFloat($("#pwheel_percent_8").val());


                if((per1+per2+per3+per4+per5+per6+per7+per8) > 100){
                    var syper = 100-(per1+per2+per3+per4+per5+per6+per7+per8-$(obj).val());
                    syper=syper.toFixed(2);
                    $(obj).val(syper);
                    alert("中奖率总和不能大于100%，已去除多余部分");
                }
            }
        }
function loadData() {
    var url="${ctx}/wheel/getWheelInfo.ac";
    $.ajax({
        url:url,
        data:{},
        type:'post',
        cache:false,
        dataType:'json',
        success:function(data) {
            var main=data.main;
            var list=data.list;

            $("#wheelmainid").val(main.id);
            $("#dzpId").html(main.qishu);
            $("#search_startdate").val(main.startTime);
            $("#search_enddate").val(main.endTime);
            if(main.state==1)
            {
                $("#dzpzt").html('<label> <font color="green">已开启</font> </label>');
                $("#divGB").show();
                $("#divKQ").hide();
                $("#divTJ").hide();
            }else
            {
                $("#dzpzt").html('<label> <font color="red">已停止</font> </label>');
                $("#divGB").hide();
                $("#divKQ").show();
                $("#divTJ").show();

            }

            for(var i=0;i<=list.length;i++)
            {
                var m=i+1;
                $("#shopPicId"+m).val(list[i].imgPath);
                $("#imgUpdate"+m).attr("src",list[i].imgPath);
                $("#pwheel_name"+m).val(list[i].name);
                $("#pwheel_type_"+m).val(list[i].type);
                $("#pwheel_num90_"+m).val(list[i].num90);
                $("#pwheel_num_"+m).val(list[i].num);
                $("#pwheel_percent_"+m).val(list[i].percent);
                $("#pwheel_type_"+m).trigger("chosen:updated");
                if(list[i].type==1){
                    $("#pwheel_num90_"+m).removeAttr("readonly");
                }else
                {
                    $("#pwheel_num90_"+m).attr("readonly","readonly");
                }


            }








        },
        error : function() {
            alert("异常！");
        }
    });
    
}


        $("#pwheel_type_1").chosen().change(function(){
            if($("#pwheel_type_1").val()==1)
            {
                $("#pwheel_num90_1").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_1").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_2").chosen().change(function(){
            if($("#pwheel_type_2").val()==1)
            {
                $("#pwheel_num90_2").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_2").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_3").chosen().change(function(){
            if($("#pwheel_type_3").val()==1)
            {
                $("#pwheel_num90_3").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_3").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_4").chosen().change(function(){
            if($("#pwheel_type_4").val()==1)
            {
                $("#pwheel_num90_4").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_4").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_5").chosen().change(function(){
            if($("#pwheel_type_5").val()==1)
            {
                $("#pwheel_num90_5").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_5").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_6").chosen().change(function(){
            if($("#pwheel_type_6").val()==1)
            {
                $("#pwheel_num90_6").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_6").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_7").chosen().change(function(){
            if($("#pwheel_type_7").val()==1)
            {
                $("#pwheel_num90_7").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_7").attr("readonly","readonly");
            }
        });
        $("#pwheel_type_8").chosen().change(function(){
            if($("#pwheel_type_8").val()==1)
            {
                $("#pwheel_num90_8").removeAttr("readonly");
            }else
            {
                $("#pwheel_num90_8").attr("readonly","readonly");
            }
        });





        function doStart()
        {
            swal({
                title: "确定要启动大转盘吗？",
                text: "启动后将无法修改奖项和活动开始时间",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "启动",
                cancelButtonText:"取消",
                closeOnConfirm: false
            },function () {
                    var wheelmainid = $("#wheelmainid").val();
                    var url = "${pageContext.request.contextPath}/wheel/doChangeState.ac?id=" + wheelmainid + "&state=1";
                    $.get(url, function (data) {
                        data=JSON.parse(data);
                        if (data == "success") {
                            alert("操作成功！");
                            location.reload();
                        }
                        else {
                            sweetAlert("无法操作！", data, "error");
                        }
                    });

            });
        }
        function doStop()
        {
            swal({
                title: "确定要停止本期大转盘吗？",
                text: "如果停止则认为本期转盘活动结束，将重置用户的3次抽奖机会！",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "停止",
                cancelButtonText:"取消",
                closeOnConfirm: false
            },function () {
                    var wheelmainid = $("#wheelmainid").val();
                    var url = "${pageContext.request.contextPath}/wheel/doChangeState.ac?id=" + wheelmainid + "&state=0";
                    $.get(url, function (data) {
                        data=JSON.parse(data);
                        if (data == "success") {
                            alert("操作成功！");
                            location.reload();
                        }
                        else {
                            sweetAlert("无法操作！", data, "error");
                        }
                    });

            });
        }




        function doSave()
        {
            var isPass = true;
            var per1 = parseFloat($("#pwheel_percent_1").val());
            var per2 = parseFloat($("#pwheel_percent_2").val());
            var per3 = parseFloat($("#pwheel_percent_3").val());
            var per4 = parseFloat($("#pwheel_percent_4").val());
            var per5 = parseFloat($("#pwheel_percent_5").val());
            var per6 = parseFloat($("#pwheel_percent_6").val());
            var per7 = parseFloat($("#pwheel_percent_7").val());
            var per8 = parseFloat($("#pwheel_percent_8").val());
            if($("#search_startdate").val()=="" || $("#search_enddate").val()==undefined){
                alert("请选择大转盘活动时间！");
                isPass=false;
            }
            else if((per1+per2+per3+per4+per5+per6+per7+per8) != 100){
                alert("奖池总概率合目前还不足100%！");
                isPass=false;
            }
            if (isPass == true)
            {
                var url="${pageContext.request.contextPath}/wheel/doSave.ac";
                $.ajax({
                    url:url,
                    data:$("#wheelForm").serialize(),
                    type:'post',
                    cache:false,
                    dataType:'json',
                    success:function(data) {
                        if(data=="success")
                        {
                            alert("操作成功！");

                            location.reload();
                        }else
                        {
                            alert(data);
                        }
                    },
                    error : function() {
                        alert("异常！");
                    }
            });
        }
        }

        function wheelRecord(level)
        {
                //自定页
                parent.layer.open({
                    type: 2,
                    shift:4,//动画类型
                    moveType:1,
                    maxmin: true,
                    shadeClose: true, //开启遮罩关闭
                    area: ['800px', '530px'],
                    content: '${pageContext.request.contextPath}/wheel/toWheelRecordByLevel.ac?level='+level,
                    success: function(layero, index){
                        var datas={"firstname":"555555"};
                        var body = layer.getChildFrame('body', index);

                    },
                    cancel: function(index){
                        return true;
                    }
                });

        }
    </script>



</html>
